package com.geekaca.d05;

import java.util.ArrayList;
import java.util.List;

public class HelloCollection {
    public static void main(String[] args) {
        ArrayList<Object> list = new ArrayList<>();
        list.add("tom");
        list.add("tom");
        list.add("Tom");
        list.add("Dom");

        for (int i = 0; i < list.size(); i++) {
            System.out.println(list.get(i));
        }
        System.out.println(list.contains("Tom"));

        list.remove("tom");

        System.out.println("isEmpty: "+list.isEmpty());
        list.clear();

        System.out.println("isEmpty: " + list.isEmpty());

        System.out.println(list.contains("Tom"));

        List myList = new ArrayList<>();
        myList.add("Tom");
        myList.add("Jack");
        myList.add("Jerry");

        List yourList = new ArrayList();
        yourList.addAll(myList);
        System.out.println(yourList.size());

        for (int i = 0; i < yourList.size(); i++) {
            System.out.println(yourList.get(i));
        }




    }
}
